# 字典
# 存储3个值  身高180 体重 180 血压 180
my_list = [180,180,180]


# 字典  存储某个对象  键值对  键：值 
user = {
    'name' : '张三',
    'age' : 18,
    'gender' : '男'
    }
# 通过键获取对应的值
print(user['name'])

# 新增
user['phone'] = '12345'
print(user)

# 修改 
user['name'] = '李四'
print(user)

# 删除
user.pop('name')
print(user)

# 获取所有的键
print(user.keys())
print(user.values())
my_list = user.values()
print(my_list)
for i in my_list:
    print(i)



# 字典嵌套
scores = {
    'zs':{
        'yw':50,
        'yy':60
    },
    'ls':{
        'yw':80,
        'yy':90
    }
}
user = [
    {
    'name' : '张三',
    'age' : 18,
    'gender' : '男'
    },
    {
    'name' : '李四',
    'age' : 17,
    'gender' : '女'
    }
]


nums_dict = {'a':10,'b':20,'c':30,'d':40}

nums_list = list(nums_dict.values())
print(nums_list)

for i in nums_list:
    print(i)

print('----最大值------')
# 最大值 
print(max(nums_list))

print('----从高到低----排序------')
# sorted 排序，默认为从低到高  reverse = True 从高到低
new_list = sorted(nums_list,reverse = True)
print(new_list)